See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

buffer
The storage location for the received data.
delimiter
The token that is used to determine a segment was read.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
found
True if delimiter is found; false otherwise.
See Also Languages PowerTCP SSL Sockets for .NET

Read(Byte[],Byte[],Int32,Int32,Boolean) Method

Dart.PowerTCP.SslSockets Namespace > SegmentedStream Class > Read Method : Read(Byte[],Byte[],Int32,Int32,Boolean) Method

Read data from the stream.

[Visual Basic]
Overloads Public Function Read( _    ByVal buffer() As Byte, _    ByVal delimiter() As Byte, _    ByVal offset As Integer, _    ByVal count As Integer, _    ByRef found As Boolean _ ) As Integer
[C#]
public int Read(    byte[] buffer,    byte[] delimiter,    int offset,    int count,    ref bool found );
[C++]
public: int Read(    byte[]* buffer,    byte[]* delimiter,    int offset,    int count,    ref bool found )
[C++/CLI]
public: int Read(    bytearray<buffer>^ buffer,    bytearray<delimiter>^ delimiter,    int offset,    int count,    % bool found )

Parameters

buffer
The storage location for the received data.
delimiter
The token that is used to determine a segment was read.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
found
True if delimiter is found; false otherwise.

Return Type

The total number of bytes read into the buffer, which will normally be less than count. Returns 0 if end of stream is reached and there is no data left to return.

Exceptions

ExceptionDescription
IOExceptionThrown when the stream is not readable.
ArgumentNullExceptionThrown when the receiving buffer is null.
ArgumentOutOfRangeExceptionThrown when the offset is less than zero or when count is less than or equal to zero.
ArgumentExceptionThrown when (offset + count) > buffer.Length.
EndOfStreamException At least one byte was read without finding the delimiter before end of stream was reached.

Remarks

This method reads from the stream and returns when the provided delimiter is found, count bytes have been read, or end of stream is reached.

The purpose of this method is to provide a convenient way to read a variable-length record from the stream.

If the delimiter is found, found is true, otherwise found is false.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.